<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class RoadShowApplyRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $editRules = [
            'status'       => 'required|in:1,-1',
        ];



//        return array();

        $data = Request::all();
        //如果是编辑
        if ($data['formType'] == 'edit') {
            return $editRules;
        }

    }

    public function attributes()
    {
        $attributes = array(
            'status'     => '是否审核通过',
        );

        return $attributes;
    }

    public function messages()
    {
        $messages = [
            'required'       => ':attribute为必填选项',
            'status.in'        => ':attribute必须为审核通过或审核不通过中的一种',
        ];

        return $messages;
    }
}
